home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ETO Development Tools 4
/
ETO Development Tools 4.iso
/
Tools - Objects
/
MacsBug
/
MacsBug 6.2.1
/
dcmds
/
C Samples
/
Where.c
< prev
Wrap
Text File
|
1991-05-01
|
1KB
|
64 lines
/* Where.c
The following MPW commands will build the dcmd and copy it to the
"Debugger Prefs" file in the System folder. The dcmd's name in
MacsBug will be the name of the file built by the Linker.
C Where.p
Link {dcmdLib}dcmdGlue.a.o Where.c.o {dcmdLib}DRuntime.o -o Where
BuildDcmd Where 102
Echo 'include "Where";' | Rez -a -o "{systemFolder}Debugger Prefs"
*/
#include <Types.h>
#include "dcmd.h"
pascal void CommandEntry (dcmdBlock* paramPtr)
{
short ch;
long address;
Boolean ok;
Str255 name;
switch (paramPtr->request)
{
case dcmdInit:
break;
case dcmdHelp:
dcmdDrawLine ("\pWHERE [addr | trap]");
dcmdDrawLine ("\p Display information about the address or trap");
dcmdDrawLine ("\p If no parameter then use PC as the address");
break;
case dcmdDoIt:
if (dcmdPeekAtNextChar () == '\n')
address = paramPtr->registerFile[PCRegister];
else
{
ch = dcmdGetNextExpression (&address, &ok);
if (!ok)
{
dcmdDrawLine ("\pSyntax error");
return;
}
}
if (address >= 0x0000A000 && address <= 0x0000ABFF)
{
dcmdGetTrapName (address, name);
dcmdDrawLine (name);
}
else
{
dcmdGetNameAndOffset (address, name);
if (name[0] > 0)
dcmdDrawLine (name);
else
dcmdDrawLine ("\pNo procedure name found");
}
break;
}
} // CommandEntry